package util

import (
	"sync"
)

// AiotTopOpenDeviceDto 结构体
type AiotTopOpenDeviceDto struct {
	// 设备唯一标识
	Uuid string `json:"uuid,omitempty" xml:"uuid,omitempty"`
	// 业务自定义参数
	ExtendStr string `json:"extend_str,omitempty" xml:"extend_str,omitempty"`
	// 组织架构
	Organization *AiotOpenDeviceOrganizationDto `json:"organization,omitempty" xml:"organization,omitempty"`
	// 基础信息
	Base *AiotOpenDeviceBaseDto `json:"base,omitempty" xml:"base,omitempty"`
	// 租户号
	TenantId int64 `json:"tenant_id,omitempty" xml:"tenant_id,omitempty"`
}

var poolAiotTopOpenDeviceDto = sync.Pool{
	New: func() any {
		return new(AiotTopOpenDeviceDto)
	},
}

// GetAiotTopOpenDeviceDto() 从对象池中获取AiotTopOpenDeviceDto
func GetAiotTopOpenDeviceDto() *AiotTopOpenDeviceDto {
	return poolAiotTopOpenDeviceDto.Get().(*AiotTopOpenDeviceDto)
}

// ReleaseAiotTopOpenDeviceDto 释放AiotTopOpenDeviceDto
func ReleaseAiotTopOpenDeviceDto(v *AiotTopOpenDeviceDto) {
	v.Uuid = ""
	v.ExtendStr = ""
	v.Organization = nil
	v.Base = nil
	v.TenantId = 0
	poolAiotTopOpenDeviceDto.Put(v)
}
